#!/bin/bash

echo "=== 系统状态实时检查 ==="

source /opt/ros/humble/setup.bash

echo "1. 节点状态:"
ros2 node list

echo ""
echo "2. 关键话题状态:"
echo "相机话题:"
ros2 topic list | grep camera | head -10

echo ""
echo "RTAB-Map话题:"
ros2 topic list | grep rtabmap | head -10

echo ""
echo "3. 数据流状态:"
echo "深度图像频率:"
timeout 3 ros2 topic hz /camera/camera/depth/image_rect_raw || echo "无数据流"

echo ""
echo "彩色图像频率:"
timeout 3 ros2 topic hz /camera/camera/color/image_raw || echo "无数据流"

echo ""
echo "点云地图频率:"
timeout 3 ros2 topic hz /rtabmap/cloud_map || echo "无数据流"

echo ""
echo "4. 服务状态:"
ros2 service list | grep save_pointcloud && echo "✅ 点云保存服务可用" || echo "❌ 点云保存服务不可用"

echo ""
echo "=== 检查完成 ==="
